<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>登录界面</title>
    <style>
         *{
            margin: 0;
            padding: 0;
        }
         body,html{
             height: 100%;
         }
        main{
            height: 100%;
            background-image: url("/api/imgs/20.jpg");
            background-attachment: fixed;
            background-size: cover;
            display: flex;
            align-items: center;
            justify-content: center;
            user-select: none;
        }
        .container{
            min-width: 600px;
            max-width: 800px;
            width: 60vw;
            height: 600px;
            background-color: #fff;
            border-radius: 10px;
            box-shadow: 2px 2px 10px gray;
            position: relative;
            overflow: hidden;
        }
        #login,#register{
            position: absolute;
            top:0;
            width: 50%;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            transition: .5s ease-out;
        }
        #login{
            left: 0;
            z-index: 2;
        }
        #register{
            right: 25%;
            z-index: -1;
        }
        .toggle-content #login{
            left: 25%;
            z-index: -1;
        }
        .toggle-content #register{
            right: 0;
            z-index: 2;
        }
        h3{
            font-size: 30px;
            font-style: italic;
            margin: 30px;
        }
        .input-value{
            outline: none;
            width: 75%;
            line-height: 30px;
            margin-bottom: 15px;
            text-indent: 10px;
            font-size: 16px;
            border: 2px solid powderblue;
            border-radius: 5px;
        }
        .input-value:focus{
            border-color: dodgerblue;
        }
        .validation{
            width: 75%;
            margin-bottom:15px;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        .validation-text{
            outline: none;
            line-height: 28px;
            width: 50%;
            text-indent: 10px;
            border: 1px solid powderblue;
        }
        .validation-text:focus{
            border: 1px dodgerblue solid;
        }
        .validation-btn{
            outline: none;
            line-height: 25px;
            width: 40%;
            letter-spacing: 3px;
        }
        .agreement{
            width: 75%;
            text-align: left;
            font-size: 12px;
        }
        input[type='checkbox']{
            vertical-align: middle;
        }
        .agreement label{
            margin-left: 10px;
            vertical-align: middle;
        }
        .change-btn{
            display: none;
        }
        .btn{
            width: 75%;
            line-height: 25px;
            margin-top: 20px;
        }
        .panel{
            position: absolute;
            z-index: 5;
            right: 0;
            width: 50%;
            height: 100%;
            background-image: url("/api/imgs/20.jpg");
            background-size: cover;
            background-attachment: fixed;
            overflow: hidden;
            transition: .5s ease-out;
        }
        #login-panel,#register-panel{
            position: absolute;
            width: 100%;
            height: 100%;
            display: flex;
            justify-content: center;
            align-items: center;
            transition: .5s ease-out;
        }
        #login-panel{
            right: 200%;
        }
        #register-panel{
            left: 0;
        }
        .panel-btn{
            outline: none;
            border: none;
            line-height: 35px;
            width: 60%;
            border-radius: 20px;
            box-shadow: 0 0 5px #47494e,
            inset 0 0 10px #7f828b;
            font-size: 18px;
            transition: .3s;
        }
        .panel-btn:hover{
            cursor: pointer;
            background-color: #71ACD8;
            color:#fff;
        }
        .toggle{
            right: 50%;
        }
        .toggle #login-panel{
            right: 0;
        }
        .toggle #register-panel{
            left: 200%;
        }
    </style>
</head>
<body>
    <main>
        <div class="container">
        <div id="login">
            <h3>欢迎登录</h3>
            <input type="text" placeholder="账号" class="input-value" v-model="account">
            <input type="password" placeholder="密码" class="input-value" v-model="password">
            <section class="validation">
                <input type="text" class="validation-text" placeholder="验证码">
                <button class="validation-btn">8888</button>
            </section>
            <section class="agreement">
                <input type="checkbox" id="read-login">
                <label for="read-login">我已阅读《用户协议》</label>
            </section>
            <button class="btn" id="login-btn">登录</button>
        </div>
        <div id="register">
            <h3>注册账号</h3>
            <input type="text" placeholder="账号" class="input-value">
            <input type="password" placeholder="密码" class="input-value">
            <input type="password" placeholder="确认密码" class="input-value">
            <section class="validation">
                <input type="text" class="validation-text" placeholder="验证码">
                <button class="validation-btn">8888</button>
            </section>
            <section class="agreement">
                <input type="checkbox" id="read-register">
                <label for="read-register">我已阅读《用户协议》</label>
            </section>
            <button class="btn">注册</button>
        </div>
        <div class="panel">
            <div id="login-panel">
                <button class="panel-btn" id="login-panel-btn">登录</button>
            </div>
            <div id="register-panel">
                <button class="panel-btn" id="register-panel-btn">注册</button>
            </div>
        </div>
    </div>
    </main>
    <script>
	    let containerDom = document.querySelector(".container");
	    let panelDom = document.querySelector(".panel");
        let login = document.querySelector('#login-panel-btn');
        let register = document.querySelector('#register-panel-btn');
        login.addEventListener('click',()=>{
	        containerDom.classList.remove("toggle-content");
	        panelDom.classList.remove("toggle");
        });
	    register.addEventListener('click',()=>{
		    containerDom.classList.add("toggle-content");
		    panelDom.classList.add("toggle");
        });
    </script>
</body>
</html>